|
Cascading Style Sheets allow for flexible formatting of a page. They should be used instead of tables for non-tabular content whenever possible, because they can be manipulated by the reader or overridden by an author if your CSS is embedded in another page via a template. ==Levels of CSS settings== Style may be chosen specifically for a piece of content, see e.g. color; scope of parameters Alternatively, style is specified for CSS selectors, expressed in terms of elements, classes and id's. This is done on various levels: Author style sheets, in this order: ''Note: See WP:CLASS for a list of all the style sheets loaded.'' * MediaWiki in general, per skin: MediaWiki Manual:Gallery of user styles etc. Typically loaded style sheets: * *(common/shared.css ) * *(common/commonPrint.css ) * *Skin-specific main file, e.g. (monobook/main.css ) (normal skin for PC's), (chick/main.css ) (normal skin for handhelds) * *Browser-specific fixes (also skin-specific). Examples for Monobook: * * *For Firefox: (monobook/FF2Fixes.css ) * * *For Internet Explorer: (monobook/IE50Fixes.css ) (monobook/IE55Fixes.css ) (monobook/IE60Fixes.css ) (monobook/IE70Fixes.css ) * * *For Opera: (monobook/Opera6Fixes.css ) (monobook/Opera7Fixes.css ) (monobook/Opera9Fixes.css ) * Site-wide for all skins: MediaWiki:Common.css * Site-wide per skin: MediaWiki:Vector.css, MediaWiki:Monobook.css, etc. * User-specific for all skins: Special:Mypage/common.css * User-specific per skin: Special:Mypage/vector.css or Special:Mypage/skin.css for your current skin (note that in CSS terminology, the user-specific style sheets are ''not'' user style sheets) User style sheet: * Web-wide, user-specific: local file, referred to in the browser settings, or directly set in the browser A HTML element may be just taken from the wikitext (see HTML in wikitext), e.g. span, or the result of translating wikitext, e.g. the code is changed into A class may be produced by the software, e.g. ns-''namespace number'' for the HTML-element "body", and extiw for an interwiki link in the page body, or taken from the wikitext. Similarly an id may be produced by the software, e.g. bodyContent, or taken from the wikitext. In the case of conflicting style settings for a piece of content, the resulting setting depends primarily on the indication "!important". Secondarily, if both are important, the user wins, if neither is, the author wins. Tertiarily it depends on specificity. Only lastly it depends on order between and within style sheets: the last wins. Thus a User:''username''/monobook.css does not win from MediaWiki:Monobook.css (both author, not user) if the specificity of the latter is greater. See also (cascade ). 抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)』 ■ウィキペディアで「Help:Cascading Style Sheets」の詳細全文を読む スポンサード リンク
|